package com.j2ee.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author ywb
 */
public class TestIOC {
    public static void main(String[] args) {
        // 1.
        // Resource resource = new ClassPathResource("applicationContext.xml");
        // 2.
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserDAO userDAO = (UserDAO) applicationContext.getBean("userDAO");
        userDAO.say();

    }
}
